package com.feishi.project.javafx.excel.convert.util;

import org.apache.tools.ant.util.FileUtils;
import org.jxls.common.Context;
import org.jxls.util.JxlsHelper;

import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: caixq
 * Date: 2020-11-04
 * Time: 上午9:42
 */
public class ExcelUtil {
    public static void export(InputStream is, OutputStream os, Map<String, Object> data) throws IOException {
        Context context = new Context();
        for (String key : data.keySet()) {
            context.putVar(key, data.get(key));
        }
        JxlsHelper.getInstance().processTemplate(is, os, context);
    }

}
